using Ardalis.Specification;

namespace Domain.Todos.Specifications;

/// <summary>
/// 按用户查询待办事项规约
/// </summary>
public sealed class TodosByUserSpecification : Specification<TodoItem>
{
    public TodosByUserSpecification(Guid userId)
    {
        Query.Where(todo => todo.UserId == userId)
             .OrderByDescending(todo => todo.CreatedAt);
    }
}